package com.wujilin.okra.database;

import com.wujilin.okra.model.Model;

import android.database.Cursor;
import android.database.CursorWrapper;

/**
 * The cursor wrapper for model.
 * 
 * @author Belin Wu
 *
 */
public class ModelCursor extends CursorWrapper {
	public ModelCursor(Cursor cursor) {
		super(cursor);
	}
	
	public Model getModel() {
		if (isBeforeFirst() || isAfterLast()) {
			return new Model();
		}
		return Model.of(getWrappedCursor());
	}
}
